<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.hengpeng.itfints.tools.PageUtil" %>
<%@include file="/page/common/public.jspf"%>
<% 
	PageUtil pageUtil = (PageUtil)request.getAttribute("PageUtil");
%>
<!DOCTYPE HTML>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员中心-融资记录</title>
<link rel="stylesheet" type="text/css" href="${path}/css/base.css"/>
<link rel="stylesheet" type="text/css" href="${path}/css/layout.css"/>
<link href="${skin }/theme.css" rel="stylesheet" type="text/css" />
<link href="${skin }/member.css" rel="stylesheet" type="text/css" />
<script src="${path }/js/common/jquery1.10.2.min.js"></script>
<script src="${path }/js/common/helper.js?v=${v}"></script>
<script src="${path }/js/common/cookie.js?v=${v}"></script>
</head>
<body bgcolor="#f9f9f9">
        <!-- head -->
		<c:import url="../../include/top.jsp"></c:import>
    	<!--主体-->
        <div class="pageCenter registeredBox" style="overflow: auto;">
        	<div class="qyMsgBox">
        		<!--左边菜单  -->
            	<c:import url="../left.jsp"></c:import>
            	<!--左边菜单  -->
                <div class="qyMsgRight float_r">
                		<div class="auto_height" style="background: #fff;margin-bottom: 20px;">
								<div style="padding: 12px">
									<div class="hkjh_top_ul1_li1div1">融资记录</div>
								</div>
							
								<div class="hkjh_top_ul1_li1div2 l">
									<div class="hkjh_hking">融资金额</div>
									<div class="hkjh_count">${myBorrowInfoMoney }元</div>
								</div>
								
								<div class="hkjh_top_ul1_li1div2 l">
									<div class="hkjh_hking">融资笔数</div>
									<div class="hkjh_count">${myBorrowInfoNum }笔</div>
								</div>
							</div>
							
							
						
							<div style="padding: 12px">
								<div class="section query">				
									<div class="thats">
										<div class="s_16">融资状态：</div>
										<input type="hidden" name="borrowInfoStatus" id="borrowInfoStatus" value="${borrowInfoStatus}"/>
										<c:choose> 
										     <c:when test="${borrowInfoStatus eq 'REPAYMENTING'}">
										     	<span class="cllradio cllradio_sys"><a onclick="select('RAISE')" lang="1" href="javascript:void(0);" class=default><i></i><em>筹款中</em></a></span>
										     	<span class="cllradio cllradio_sys"><a onclick="select('END')" lang="1" href="javascript:void(0);" class=default><i></i><em>筹款结束</em></a></span>
										      	<span class="cllradio cllradio_sys"><a onclick="select('REPAYMENTING')" href="javascript:void(0);" class="select"><i></i><em>还款中</em></a></span>
										        <span class="cllradio cllradio_sys"><a onclick="select('REPAYMENTED')" lang="1" href="javascript:void(0);" class=default><i></i><em>已还清</em></a></span>
										     </c:when> 
										     <c:when test="${borrowInfoStatus eq 'REPAYMENTED'}">
										     	<span class="cllradio cllradio_sys"><a onclick="select('RAISE')" lang="1" href="javascript:void(0);" class=default><i></i><em>筹款中</em></a></span>
										      	<span class="cllradio cllradio_sys"><a onclick="select('END')" lang="1" href="javascript:void(0);" class=default><i></i><em>筹款结束</em></a></span>
										      	<span class="cllradio cllradio_sys"><a onclick="select('REPAYMENTING')" href="javascript:void(0);" class="default"><i></i><em>还款中</em></a></span>
										        <span class="cllradio cllradio_sys"><a onclick="select('REPAYMENTED')" lang="1" href="javascript:void(0);" class=select><i></i><em>已还清</em></a></span>
										     </c:when>
										     <c:when test="${borrowInfoStatus eq 'RAISE'}">
										     	<span class="cllradio cllradio_sys"><a onclick="select('RAISE')" lang="1" href="javascript:void(0);" class=select><i></i><em>筹款中</em></a></span>
										      	<span class="cllradio cllradio_sys"><a onclick="select('END')" lang="1" href="javascript:void(0);" class=default><i></i><em>筹款结束</em></a></span>
										      	<span class="cllradio cllradio_sys"><a onclick="select('REPAYMENTING')" href="javascript:void(0);" class="default"><i></i><em>还款中</em></a></span>
										        <span class="cllradio cllradio_sys"><a onclick="select('REPAYMENTED')" lang="1" href="javascript:void(0);" class=default><i></i><em>已还清</em></a></span>
										     </c:when> 
										     <c:when test="${borrowInfoStatus eq 'END'}">
										     	<span class="cllradio cllradio_sys"><a onclick="select('RAISE')" lang="1" href="javascript:void(0);" class=default><i></i><em>筹款中</em></a></span>
										      	<span class="cllradio cllradio_sys"><a onclick="select('END')" lang="1" href="javascript:void(0);" class=select><i></i><em>筹款结束</em></a></span>
										      	<span class="cllradio cllradio_sys"><a onclick="select('REPAYMENTING')" href="javascript:void(0);" class="default"><i></i><em>还款中</em></a></span>
										        <span class="cllradio cllradio_sys"><a onclick="select('REPAYMENTED')" lang="1" href="javascript:void(0);" class=default><i></i><em>已还清</em></a></span>
										     </c:when> 
										     <c:otherwise>
										     	<span class="cllradio cllradio_sys"><a onclick="select('RAISE')" lang="1" href="javascript:void(0);" class=default><i></i><em>筹款中</em></a></span>
										      	<span class="cllradio cllradio_sys"><a onclick="select('RAISE')" lang="1" href="javascript:void(0);" class=default><i></i><em>筹款结束</em></a></span>
										      	<span class="cllradio cllradio_sys"><a onclick="select('REPAYMENTING')" href="javascript:void(0);" class="select"><i></i><em>还款中</em></a></span>
										        <span class="cllradio cllradio_sys"><a onclick="select('REPAYMENTED')" lang="1" href="javascript:void(0);" class=default><i></i><em>已还清</em></a></span>
										     </c:otherwise>
									    </c:choose>
									</div>
								</div>
							</div>
								<ul class="account_item_title">
									<li style="text-align:center;width:96px;">标的名称</li>
									<li>借款金额(元)</li>
									<li>借款期限</li>
									<li>年化率</li>
									<li>
										<c:choose> 
										     <c:when test="${borrowInfoStatus eq 'REPAYMENTING'}">待还本息(元)</c:when> 
										     <c:when test="${borrowInfoStatus eq 'REPAYMENTED'}">还款总额(元)</c:when>
										     <c:when test="${borrowInfoStatus eq 'RAISE' || borrowInfoStatus eq 'END'}">投标进度</c:when> 
										     <c:otherwise>待还本息</c:otherwise>
									    </c:choose>
									</li>
									<li>
										<c:choose> 
										     <c:when test="${borrowInfoStatus eq 'REPAYMENTING'}">未还期数</c:when> 
										     <c:when test="${borrowInfoStatus eq 'REPAYMENTED'}">还清日期</c:when>
										     <c:when test="${borrowInfoStatus eq 'RAISE' || borrowInfoStatus eq 'END'}">已募金额(元)</c:when> 
										     <c:otherwise>未还期数</c:otherwise>
									    </c:choose>
									</li>
									<li>状态</li>
									
									<li style="width:92px;text-align:center;">合同</li>
									
								</ul>
								<c:choose> 
								     <c:when test="${fn:length(myBorrowInfoList) > 0}"> 
								      		<c:forEach items="${myBorrowInfoList}" var="borrow" begin="<%=pageUtil.getFromIndex()%>" end="<%=pageUtil.getToIndex() %>" varStatus="vstatus">
												<c:choose>
										            <c:when test="${vstatus.index%2 == 0}">
										  				<ul class="account_item_title2">
															<li style="text-align:center;width:96px;">
																<a href="javascript:void(0);" onclick="myrepaymentplan('${borrow.id}')" class="d_blue">
																	<c:choose> 
																	     <c:when test="${fn:length(borrow.borrowName) > 6}"> 
																	      	<c:out value="${fn:substring(borrow.borrowName, 0, 6)}..." /> 
																	     </c:when> 
																	     <c:otherwise> 
																	      	<c:out value="${borrow.borrowName}" /> 
																	     </c:otherwise>
																    </c:choose>
																</a>
															</li>
															<li>${borrow.borrowMoney/100}</li>
															<li>${borrow.borrowDuration}
																<c:choose>
										                    		<c:when test="${borrow.durType eq 'MONTH' }">个月</c:when>
										                    		<c:when test="${borrow.durType eq 'DAY' }">天</c:when>
										                    		<c:otherwise></c:otherwise>
										                    	</c:choose>
															</li>
															<li>${borrow.borrowRate}%</li>
															<li>
																<c:choose> 
																     <c:when test="${borrowInfoStatus eq 'REPAYMENTING'}">${borrow.unRepayMoney/100}</c:when> 
																     <c:when test="${borrowInfoStatus eq 'REPAYMENTED'}">${borrow.totalRepayMoney/100}</c:when>
																     <c:when test="${borrowInfoStatus eq 'RAISE'  || borrowInfoStatus eq 'END'}">
																     	<fmt:formatNumber type="number" value="${(borrow.raiseMoney / borrow.borrowMoney) * 100}" maxFractionDigits="1"/>%
																     </c:when> 
																     <c:otherwise>${borrow.unRepayMoney/100}</c:otherwise>
															    </c:choose>
															</li>
															<li>
																<c:choose> 
																     <c:when test="${borrowInfoStatus eq 'REPAYMENTING'}">${borrow.unRepayNum}</c:when> 
																     <c:when test="${borrowInfoStatus eq 'REPAYMENTED'}">
																     	<fmt:formatDate value="${borrow.repaymentedTime}" type="both" pattern="yyyy/MM/dd"/></c:when>
																     <c:when test="${borrowInfoStatus eq 'RAISE'  || borrowInfoStatus eq 'END'}">${borrow.raiseMoney/100}</c:when> 
																     <c:otherwise>${borrow.unRepayNum}</c:otherwise>
															    </c:choose>
															</li>
															<li>${borrow.status.text}</li>
															 
															<li style="width:92px;text-align:center;"><a href="#" class="d_blue">查看</a></li>
															
														</ul>
										            </c:when>
										            <c:otherwise>
										    			<ul class=account_item_title3>
															<li style="text-align:center;width:96px;">
																<a href="javascript:void(0);" onclick="myrepaymentplan('${borrow.id}')" class="d_blue">
																	<c:choose> 
																	     <c:when test="${fn:length(borrow.borrowName) > 6}"> 
																	      	<c:out value="${fn:substring(borrow.borrowName, 0, 6)}..." /> 
																	     </c:when> 
																	     <c:otherwise> 
																	      	<c:out value="${borrow.borrowName}" /> 
																	     </c:otherwise>
																    </c:choose>
																</a>
															</li>
															<li>${borrow.borrowMoney/100}</li>
															<li>${borrow.borrowDuration}
																<c:choose>
										                    		<c:when test="${borrow.durType eq 'MONTH' }">个月</c:when>
										                    		<c:when test="${borrow.durType eq 'DAY' }">天</c:when>
										                    		<c:otherwise></c:otherwise>
										                    	</c:choose></li>
															<li>${borrow.borrowRate}%</li>
															<li>
																<c:choose> 
																     <c:when test="${borrowInfoStatus eq 'REPAYMENTING'}">${borrow.unRepayMoney/100}</c:when> 
																     <c:when test="${borrowInfoStatus eq 'REPAYMENTED'}">${borrow.totalRepayMoney/100}</c:when>
																     <c:when test="${borrowInfoStatus eq 'RAISE'  || borrowInfoStatus eq 'END'}">
																     	<fmt:formatNumber type="number" value="${(borrow.raiseMoney / borrow.borrowMoney) * 100}" maxFractionDigits="1"/>%
																     </c:when> 
																     <c:otherwise>${borrow.unRepayMoney/100}</c:otherwise>
															    </c:choose>
															</li>
															<li>
																<c:choose> 
																     <c:when test="${borrowInfoStatus eq 'REPAYMENTING'}">${borrow.unRepayNum}</c:when> 
																     <c:when test="${borrowInfoStatus eq 'REPAYMENTED'}">
																     	<fmt:formatDate value="${borrow.repaymentedTime}" type="both" pattern="yyyy/MM/dd"/></c:when>
																     <c:when test="${borrowInfoStatus eq 'RAISE'  || borrowInfoStatus eq 'END'}">${borrow.raiseMoney/100}</c:when> 
																     <c:otherwise>${borrow.unRepayNum}</c:otherwise>
															    </c:choose>
															</li>
															<li>${borrow.status.text}</li>
															
															<li style="width:92px;text-align:center;"><a href="#" class="d_blue">查看</a></li>
														
														</ul>
										            </c:otherwise>
										        </c:choose>
											</c:forEach>  
								     </c:when> 
								     <c:otherwise> 
								      		<div class="s_13" style="width: 100%;clear: both;">
												<div style="line-height: 60px; font-size: 16px; text-align: center;">暂无融资记录</div>
											</div>
								     </c:otherwise>
							    </c:choose>
								<div class="clearfix section"></div>
								
							<div class="paginations">
								<div class="page-bottom">
								 	<!--  
									<a href="/article/201-1.htm" name="pagebar_frist" class="page-start"><span>首页</span></a>
									<a href="/article/201-1.htm" name="pagebar_pre" class="page-prev"><span>上一页</span></a>
									<span class="page-cur">1</span><a href="/article/201-2.htm">2</a><span class="page-break">...</span>
									<a name="pagebar_next" href="/article/201-2.htm" class="page-next"><span>下一页</span></a>
									<a name="pagebar_last" href="/article/201-84.htm" class="page-end"><span>末页</span></a>
									<span class="page-skip"><span style="margin-top: 2px;" class="inputcheckbox l">共3页 到第 <input type="text" id="pagebar_page_text" size="4" value="1">页</span>
									<button id="pagebar_go" type="button">确定</button></span>
								-->
									
									记录总数<%=pageUtil.getTotalCount()%>条 当前页/总页数<%=pageUtil.getCurrentPage()%> 
									/<%=pageUtil.getPageCount()%>每页显示<%=pageUtil.getPageSize()%>条 
									<a onclick="javascript:go(1);" href="javascript:void(0);" name="pagebar_frist" class="page-start"><span>首页</span></a> 
									<a onclick="javascript:go(<%=(pageUtil.getCurrentPage() - 1)%>);" href="javascript:void(0);" name="pagebar_pre" class="page-prev"><span>上一页</span></a> 
									<a onclick="javascript:go(<%=(pageUtil.getCurrentPage() + 1)%>);" href="javascript:void(0);" name="pagebar_next" class="page-next"><span>下一页</span></a> 
									<a onclick="javascript:go(<%=pageUtil.getPageCount()%>);" href="javascript:void(0);" name="pagebar_last" class="page-end"><span>末页</span></a> 
								</div>
							</div>
                </div>
                <div class="clear_both"></div> 
         	</div>       
        </div>
        </div>
    	<!--主体-->
    	
<!--foot-->
	<c:import url="../../include/foot.jsp"></c:import>
<!--foot--> 

<script type="text/javascript">
	function go (page) {
		window.location.href = "<%=request.getContextPath()%>/borrowInfo/myBorrowInfoList.htm?page="+page+"&borrowInfoStatus="+$("#borrowInfoStatus").val();
	}
	function select (borrowInfoStatus) {
		window.location.href = "<%=request.getContextPath()%>/borrowInfo/myBorrowInfoList.htm?page=1&borrowInfoStatus="+borrowInfoStatus;
	}
	//查看还款计划
	function myrepaymentplan (borrowInfoId) { 
		window.location.href = "<%=request.getContextPath()%>/repayment/myRepayMentList.htm?borrowInfoId="+borrowInfoId+"";
	}
</script>    
</body>
</html>

